Method and device for processing portrait image, electronic equipment, and storage medium

ABSTRACT

The present application relates to a method and a device for processing a portrait image. The method includes determining a skin region, a skin flat region, a speckle region, and a portrait structure region. Performing a dermabrasion processing on the skin flat region and a speckle removal processing on the speckle region and overlaying the high-frequency output image after dermabrasion and speckle removal with the low-frequency output image after dermabrasion and speckle removal, to obtain a skin region output image. The method enables to present realistic skin texture and protect the clarity of portrait structure while achieving dermabrasion and speckle removal on skin in a portrait image.

FIELD OF THE INVENTION

The present application relates to the field of image processingtechnology, and particularly, to a method and a device for processing aportrait image, an electronic equipment, and a storage medium.

BACKGROUND OF THE INVENTION

In mobile phones and other photography and video equipments, photographyand video beautification are widely used. In the process of beautifyingcaptured portrait images, dermabrasion and speckle removal algorithmsmay be used in dermabrasion and speckle removal processing for theportrait skin regions in the portrait images, to obtain a betterappearance for the skin. An ideal dermabrasion and speckle removalalgorithm requires both the ability to remove blemishes in portrait skin(such as freckles, acne marks, pigment mass deposition, etc.) and thefinal presentation of a delicate and realistic skin texture, withoutlosing the clarity of the portrait contour.

However, most existing dermabrasion and speckle removal algorithms areprone to significant loss of details during the process of dermabrasionand speckle removal on portrait skin regions, resulting in overly bluntand unnatural effects. It has become an urgent demand to beautify theskin of portraits with nature and fidelity.

SUMMARY OF THE INVENTION

On this Basis, it is necessary to provide a method and a device forprocessing a portrait image, an electronic equipment, and storage mediumcapable of retaining a true texture of a portrait image while performingdermabrasion and speckle removal on the portrait image.

A method for processing a portrait image, including: determining a skinregion image in a portrait image to be processed, as well as a skin flatregion, a speckle region, and a portrait structure region included in ahigh-frequency component image and a low-frequency component image ofthe skin region image; performing a dermabrasion processing on the skinflat region and a speckle removal processing on the speckle region inthe high-frequency component image and the low-frequency componentimage, respectively, with protection for the portrait structure regionin the high-frequency component image and the low-frequency componentimage, to obtain a high-frequency output image after dermabrasion andspeckle removal and a low-frequency output image after dermabrasion andspeckle removal; and overlaying the high-frequency output image afterdermabrasion and speckle removal with the low-frequency output imageafter dermabrasion and speckle removal, to obtain a skin region outputimage.

According to one embodiment, the determining a skin region image in aportrait image to be processed, as well as a skin flat region, a speckleregion, and a portrait structure region included in a high-frequencycomponent image and a low-frequency component image of the skin regionimage includes: identifying and extracting the skin region image fromthe portrait image to be processed; dividing the skin region image intothe high-frequency component image and the low-frequency componentimage; and identifying the skin flat region, the speckle region, and theportrait structure region included in the high-frequency component imageand the low-frequency component image, respectively.

According to one embodiment, the method for processing a portrait imagefurther includes: extracting a non-skin region image from the portraitimage to be processed; and stitching the non-skin region image with theskin region output image, to obtain a portrait output image.

According to one embodiment, the dividing the skin region image into thehigh-frequency component image and the low-frequency component imageincludes: performing Gaussian filtering on the skin region image toobtain the low-frequency component image; and subtracting thelow-frequency component image from the skin region image, to obtain thehigh-frequency component image.

According to one embodiment, the performing a dermabrasion processing onthe skin flat region and a speckle removal processing on the speckleregion in the high-frequency component image and the low-frequencycomponent image, respectively, with protection for the portraitstructure region in the high-frequency component image and thelow-frequency component image, to obtain a high-frequency output imageafter dermabrasion and speckle removal and a low-frequency output imageafter dermabrasion and speckle removal includes: performing a firstdermabrasion processing on the skin flat region and a first speckleremoval processing on the speckle region in the high-frequency componentimage, with protection for the portrait structure region in thehigh-frequency component image, to obtain the high-frequency outputimage after dermabrasion and speckle removal; and performing a seconddermabrasion processing on the skin flat region and a second speckleremoval processing on the speckle region in the low-frequency componentimage, with protection for the portrait structure region in thelow-frequency component image, to obtain the low-frequency output imageafter dermabrasion and speckle removal.

According to one embodiment, the first dermabrasion processing isdifferent from the second dermabrasion processing, and/or the firstspeckle removal processing is different from the second speckle removalprocessing.

According to one embodiment, the performing a dermabrasion processing onthe skin flat region in the high-frequency component image includes:performing nonlinear attenuation on the skin flat region in thehigh-frequency component image; wherein, in the nonlinear attenuation,each pixel value in the high-frequency component image is multiplied bya variable attenuation coefficient that decreases with the decrease ofthe pixel value multiplied thereby.

According to one embodiment, performing the speckle removal processingon the speckle region in the high-frequency component image includes:performing mirror four-vertex linear interpolation on each pixel in thespeckle region in the high-frequency component image, to fill eachpixel; wherein, in the mirror four-vertex linear interpolation, for atarget pixel to be filled, four boundaries of the speckle region havingthe target pixel in four direction as of top bottom, left, and right aredetermined and taken respectively as centers to determine foursymmetrical pixels outside the speckle region of the target pixel, and avalue determined by performing bilinear interpolation on the foursymmetrical pixels is used as the pixel value of the target pixel, so asto fill the target pixel.

According to one embodiment, the performing a dermabrasion processing onthe skin flat region in the low-frequency component image includes:performing surface filtering on the skin flat region in thelow-frequency component image.

According to one embodiment, performing the speckle removal processingon the speckle region in the low-frequency component image includes:performing adjacent four-vertex linear interpolation on each pixel inthe speckle region in the low-frequency component image, to fill eachpixel; wherein, in the adjacent four-vertex linear interpolation, for atarget pixel to be filled, four nearest neighbor pixels to the targetpixel outside the speckle region in four directions of top, bottom, leftand right are determined, and a value determined by performing bilinearinterpolation on the four nearest neighbor pixels is used as the pixelvalue of the target pixel, so as to fill the target pixel.

According to one embodiment, the protection for the portrait structureregion in the high-frequency component image and the low-frequencycomponent image includes: generating a mask for the portrait structureregion; wherein, the mask is used to ensure that, it is prohibited toperform the dermabrasion processing or the speckle removal processing onthe portrait structure region, when performing a dermabrasion processingon the skin flat region and a speckle removal processing on the speckleregion in the high-frequency component image and the low-frequencycomponent image.

A device for processing a portrait image, including: a region imagedetermination module for determining a skin region image in a portraitimage to be processed, as well as a skin flat region, a spot region, anda portrait structure region included in a high-frequency component imageand a low-frequency component image of the skin region image; a regionimage processing module for performing a dermabrasion processing on theskin flat region and a speckle removal processing on the speckle regionin the high-frequency component image and the low-frequency componentimage, respectively, with protection for the portrait structure regionin the high-frequency component image and the low-frequency componentimage, to obtain a high-frequency output image after dermabrasion andspeckle removal and a low-frequency output image after dermabrasion andspeckle removal; and a skin region output module for overlaying thehigh-frequency output image after dermabrasion and speckle removal withthe low-frequency output image after dermabrasion and speckle removal,to obtain a skin region output image.

An electronic equipment, including a memory that stores a computerprogram and a processor that executes the computer program bydetermining a skin region image in a portrait image to be processed, aswell as a skin flat region, a speckle region, and a portrait structureregion included in a high-frequency component image and a low-frequencycomponent image of the skin region image; performing a dermabrasionprocessing on the skin flat region and a speckle removal processing onthe speckle region in the high-frequency component image and thelow-frequency component image, respectively, with protection for theportrait structure region in the high-frequency component image and thelow-frequency component image, to obtain a high-frequency output imageafter dermabrasion and speckle removal and a low-frequency output imageafter dermabrasion and speckle removal; and overlaying thehigh-frequency output image after dermabrasion and speckle removal withthe low-frequency output image after dermabrasion and speckle removal,to obtain a skin region output image.

A computer-readable storage medium on which a computer program isstored, wherein the computer program is executed by a processor bydetermining a skin region image in a portrait image to be processed, aswell as a skin flat region, a speckle region, and a portrait structureregion included in a high-frequency component image and a low-frequencycomponent image of the skin region image; performing a dermabrasionprocessing on the skin flat region and a speckle removal processing onthe speckle region in the high-frequency component image and thelow-frequency component image, respectively, with protection for theportrait structure region in the high-frequency component image and thelow-frequency component image, to obtain a high-frequency output imageafter dermabrasion and speckle removal and a low-frequency output imageafter dermabrasion and speckle removal; and overlaying thehigh-frequency output image after dermabrasion and speckle removal withthe low-frequency output image after dermabrasion and speckle removal,to obtain a skin region output image.

The above-mentioned method and device for processing a portrait image,electronic equipment, and storage medium enable to perform optimizationprocessing specific to different high and low frequency components anddifferent types of skin regions, while maximize the retained clarity ofthe portrait structure region, by means of determining the skin regionimage in the portrait image to be processed, as well as the skin flatregion, the speckle region, and the portrait structure region includedin the high-frequency component image and the low-frequency componentimage of the skin region image, and performing a dermabrasion processingon the skin flat region and a speckle removal processing on the speckleregion in the high-frequency component image and the low-frequencycomponent image, respectively, with protection for the portraitstructure region in the high-frequency component image and thelow-frequency component image. Thus, enabling to present realistic skintexture and protect the clarity of portrait structure while achievedermabrasion and speckle removal on skin in a portrait image, making thebeautified portrait image have a more realistic texture. Otherobjectives and aspects of the invention will become apparent from thefollowing detailed description, taken in conjunction with theaccompanying drawings, which illustrate, by way for example, thefeatures in accordance with embodiments of the invention.

To the accomplishment of the above and related objects, this inventionmay be embodied in the form illustrated in the accompanying drawings,attention being called to the fact, however, that the drawings areillustrative only, and that changes may be made in the specificconstruction illustrated and described within the scope of the appendedclaims.

Although, the invention is described above in terms of various exemplaryembodiments and implementations, it should be understood that thevarious features, aspects, and functionality described in one or more ofthe individual embodiments are not limited in their applicability to theparticular embodiment with which they are described, but instead can beapplied, alone or in various combinations, to one or more of the otherembodiments of the invention, whether or not such embodiments aredescribed and whether or not such features are presented as being a partof a described embodiment. Thus, the breadth and scope of the presentinvention should not be limited by any of the above-described exemplaryembodiments.

The presence of broadening words and phrases such as “one or more,” “atleast,” “but not limited to” or other like phrases in some instancesshall not be read to mean that the narrower case is intended or requiredin instances where such broadening phrases may be absent.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings illustrate various embodiments of systems,methods, and embodiments of various other aspects of the disclosure. Anyperson with ordinary skills in the art will appreciate that theillustrated element boundaries (e.g. boxes, groups of boxes, or othershapes) in the figures represent one example of the boundaries. It maybe that in some examples one element may be designed as multipleelements or that multiple elements may be designed as one element. Insome examples, an element shown as an internal component of one elementmay be implemented as an external component in another and vice versa.Furthermore, elements may not be drawn to scale. Non-limiting andnon-exhaustive descriptions are described with reference to thefollowing drawings. The components in the figures are not necessarily toscale, emphasis instead being placed upon illustrating principles.Furthermore, the drawings may contain text or captions that may explaincertain embodiments of the present invention. This text is included forillustrative, non-limiting, explanatory purposes of certain embodimentsdetailed in the present invention. In the drawings:

Embodiments of the invention are described with reference to thefollowing figures. The same numbers are used throughout the figures toreference similar features and components. The features depicted in thefigures are not necessarily shown to scale. Certain features of theembodiments may be shown exaggerated in scale or in somewhat schematicform, and some details of elements may not be shown in the interest ofclarity and conciseness.

FIG. 1 is a schematic view of an electronic equipment according to oneembodiment.

FIG. 2 is a schematic flowchart of a method for processing a portraitimage according to one embodiment.

FIG. 3 is a schematic flowchart of a method for processing a portraitimage according to one embodiment.

FIG. 4 is a schematic flowchart of a method for processing a portraitimage according to one embodiment.

FIG. 5 is a view of a nonlinear attenuation curve according to oneembodiment.

FIG. 6 is a schematic view of a speckle region mask in a high-frequencycomponent image of a portrait image according to one embodiment.

FIG. 7 is a schematic view of mirror four-vertex linear interpolationaccording to one embodiment.

FIG. 8 is a schematic view of adjacent four-vertex linear interpolationaccording to one embodiment.

FIG. 9 is a schematic view of protection for a portrait structureaccording to one embodiment.

FIG. 10 is a structure block diagram of a device for processing aportrait image according to one embodiment.

FIG. 11 is an internal structure diagram of an electronic equipmentaccording to one embodiment.

FIG. 12 is a schematic structure diagram of an electronic equipmentaccording to one embodiment.

DETAILED DESCRIPTION OF THE INVENTION

The present specification is directed towards multiple embodiments. Thefollowing disclosure is provided in order to enable a person havingordinary skill in the art to practice the invention. Language used inthis specification should not be interpreted as a general disavowal ofany one specific embodiment or used to limit the claims beyond themeaning of the terms used therein. The general principles defined hereinmay be applied to other embodiments and applications without departingfrom the spirit and scope of the invention. Also, the terminology andphraseology used is for the purpose of describing exemplary embodimentsand should not be considered limiting. Thus, the present invention is tobe accorded the widest scope encompassing numerous alternatives,modifications and equivalents consistent with the principles andfeatures disclosed. For clarity, details relating to technical materialthat is known in the technical fields related to the invention have notbeen described in detail so as not to unnecessarily obscure the presentinvention.

In the description and claims of the application, each of the words“units” represents the dimension in any units such as centimeters,meters, inches, foots, millimeters, micrometer and the like and formsthereof, are not necessarily limited to members in a list with which thewords may be associated.

In the description and claims of the application, each of the words“comprise”, “include”, “have”, “contain”, and forms thereof, are notnecessarily limited to members in a list with which the words may beassociated. Thus, they are intended to be equivalent in meaning and beopen-ended in that an item or items following any one of these words isnot meant to be an exhaustive listing of such item or items or meant tobe limited to only the listed item or items. It should be noted hereinthat any feature or component described in association with a specificembodiment may be used and implemented with any other embodiment unlessclearly indicated otherwise.

Regarding applicability of 35 U.S.C. § 112, 916, no claim element isintended to be read in accordance with this statutory provision unlessthe explicit phrase “means for” or “step for” is actually used in suchclaim element, whereupon this statutory provision is intended to applyin the interpretation of such claim element.

Furthermore, it is important to note that, as used herein, “a” and “an”each generally denotes “at least one,” but does not exclude a pluralityunless the contextual use dictates otherwise. When used herein to join alist of items, “or” denotes “at least one of the items,” but does notexclude a plurality of items from the list. Finally, when used herein tojoin a list of items, “and” denotes “all of the items of the list.”

The following detailed description refers to the accompanying drawings.Wherever possible, the same reference numbers are used in the drawingsand the following description to refer to the same or similar elements.While many embodiments of the disclosure may be described,modifications, adaptations, and other implementations are possible. Forexample, substitutions, additions, or modifications may be made to theelements illustrated in the drawings, and the methods described hereinmay be modified by substituting, reordering, or adding stages to thedisclosed methods. Accordingly, the following detailed description doesnot limit the disclosure. Instead, the proper scope of the disclosure isdefined by the appended claims. The present invention contains headers.It should be understood that these headers are used as references andare not to be construed as limiting upon the subjected matter disclosedunder the header.

This specification comprises references to “one embodiment” or “anembodiment.” The appearances of the phrases “in one embodiment” or “inan embodiment” do not necessarily refer to the same embodiment.Particular features, structures, or characteristics may be combined inany suitable manner consistent with this disclosure.

The presence of broadening words and phrases such as “one or more,” “atleast,” “but not limited to” or other like phrases in some instancesshall not be read to mean that the narrower case is intended or requiredin instances where such broadening phrases may be absent.

It must also be noted that as used herein and in the appended claims,the singular forms “a,” “an,” and “the” include plural references unlessthe context dictates otherwise. Although any systems and methods similaror equivalent to those described herein can be used in the practice ortesting of embodiments of the present disclosure, the preferred systemsand methods are now described.

In order to make the purposes, technical solutions, and advantages ofthe present application clearer, the following is a further detailedexplanation of the present application in conjunction with theaccompanying drawings and embodiments. It should be understood that, thespecific embodiments described here are only used to explain and are notintended to limit the present application.

The method for processing a portrait image provided in the presentapplication may be applied to the electronic equipment 100 shown in FIG.1 , which may be, but is not limited to, various smartphones, digitalcameras, personal computers, laptops, tablets, etc. The electronicequipment 100 may be equipped with a camera 101, captures a portraitimage to be processed in real time through the camera 101, and performsthe method for processing a portrait image according to embodiments ofthe present application on the portrait image, to obtain a skin regionoutput image for subsequent applications. According to an alternativeembodiment, the electronic equipment 100 may also obtain the portraitimage to be processed from other equipments through network or othercommunication manners, or read the portrait image to be processed fromthe local memory, and then perform the method for processing a portraitimage according to embodiments of the present application on theobtained portrait image. The electronic equipment 100 may further beequipped with a display screen 102, so that the electronic equipment 100may display an obtained skin region output image or a further processedskin region output image on the display screen 102 for users to view.

According to one embodiment, what is provided is a method for processinga portrait image, which may be applied in the electronic equipment 100shown in FIG. 1 . As shown in FIGS. 2 and 4 , this method comprises thefollowing steps S210-S230.

Step S210. determining a skin region image in a portrait image to beprocessed, as well as a skin flat region, a speckle region, and aportrait structure region included in a high-frequency component imageand a low-frequency component image of the skin region image.

According to one embodiment, as shown in FIG. 3 , step S210 may includethe following steps S211-S213.

Step S211. identifying and extracting the skin region image from theportrait image to be processed.

As shown in FIG. 3 , the method may further include: step S201.obtaining the portrait image to be processed before step S210.

Here, the portrait image to be processed may be an original imagecaptured in real-time by the electronic equipment 100, or an image aftercertain processing on the original image, or may also be an image readfrom other equipment or the local memory of the electronic equipment100. The portrait image to be processed contains information about aportrait.

The skin region refers to the area(s) where the human skin is generallylocated in the image. For example, the skin region may include facialregions for facial beautification applications. However, it should beunderstood that, in practical applications, the skin region may alsoinclude other human skin regions such as ears, neck, hands, etc. thatis, the method for processing a portrait image according to the presentapplication may also identify and process other human skin regions suchas ears, neck, arms, hands, etc. during application.

Identification of the skin region may be achieved using any knowntechniques, such as, Artificial Intelligence (AI) models, etc., such as,for example, the U-NET model recited in the literature “Ronneberger O,Fischer P, Brox T. U-Net: Convolutional Networks for Biomedical ImageSegmentation[J]. Springer, Cham, 2015”, the present application willthus not elaborate thereon. After identifying the skin region from theportrait image, the skin region image in the skin region may beextracted accordingly.

Step S212. dividing the skin region image into a high-frequencycomponent image and a low-frequency component image.

The high-frequency component in the portrait image represents a part ofthe image where the color and texture change sharply, while thelow-frequency component in the portrait image represents a part of theimage where the color and texture change slowly. Generally speaking,skin texture information and speckle blemishes of portraits are mainlyconcentrated in the high-frequency component, while relatively largespeckles and facial structure information of skin mainly exist in thelow-frequency component.

In this step, the skin region image is divided into a high-frequencycomponent image and a low-frequency component image by frequencydivision processing, in order to perform differential processing on thehigh-frequency component image and low-frequency component imagesubsequently, making the skin tone more uniform and the skin texturemore delicate and realistic after dermabrasion and speckle removal.Frequency division processing is carried out for each pixel in the skinregion image. By dividing each pixel in the skin region image into ahigh-frequency component pixel and a low-frequency component pixel, allthe high-frequency component pixels form a high-frequency componentimage, and all the low-frequency component pixels form a low-frequencycomponent image, the skin region image is thus divided into ahigh-frequency component image and a low-frequency component image. Itshould be understood that, the high-frequency component image andlow-frequency component image obtained by division will have the sameresolution as the skin region image, respectively.

Step S213. identifying the skin flat region, the speckle region, and theportrait structure region included in the high-frequency component imageand low-frequency component image, respectively.

Here, the skin flat region refers to areas where the skin is evenlydistributed, such as face, forehead, chin, and other areas. For example,the skin flat region may be roughly equal to the remaining part of theskin region after removing the speckle region and the portrait structureregion. The speckle region refers to areas in the skin where freckles,acne marks, and other blemishes are located. The portrait structureregion refers to areas that need to be protected where the organstructures in a human body is located. The portrait structure region maybe specifically defined as including different regions according to theapplication needs. Taking application to facial beauty as an example,the portrait structure region may include areas where eyes, eyebrows,nose, mouth, and outer contour of the face are located. In otherembodiments, however, the portrait structure region may also includemore or fewer areas or different areas. For example, for handbeautification, the portrait structure region may include areas where,such as, nails and the contour of the hand are located.

Identification of the skin flat region, the speckled region, and theportrait structure region may be achieved using any known techniques,such as, AI models, etc., such as, for example, the U-NET model recitedin the literature “Ronneberger O, Fischer P, Brox T. U-Net:Convolutional Networks for Biomedical Image Segmentation[J]. Springer,Cham, 2015”, the present application will thus not elaborate thereon.

It should be understood that, for steps S212-S213, it is also possibleto identify the skin flat region, the speckle region, and the portraitstructure region from the skin region image first, and then divide theidentified skin region image into the high-frequency component image andthe low-frequency component image. Alternatively, for steps S211-S213,it is also possible to identify the skin region, the skin flat region,the speckle region, and the portrait structure region from the portraitimage to be processed first, and then extract the skin region image andperform frequency division processing, and so on. These equivalents arelikewise capable of determining the skin flat region, the speckleregion, and the portrait structure region included in the high-frequencycomponent image and the low-frequency component image.

Step S220. performing a dermabrasion processing on the skin flat regionand a speckle removal processing on the speckle region in thehigh-frequency component image and the low-frequency component image,respectively, with protection for the portrait structure region in thehigh-frequency component image and the low-frequency component image, toobtain a high-frequency output image after dermabrasion and speckleremoval and a low-frequency output image after dermabrasion and speckleremoval.

Specifically, this step S220 may include: performing a firstdermabrasion processing on the skin flat region and a first speckleremoval processing on the speckle region in the high-frequency componentimage, with protection for the portrait structure region in thehigh-frequency component image, to obtain the high-frequency outputimage after dermabrasion and speckle removal; and performing a seconddermabrasion processing on the skin flat region and a second speckleremoval processing on the speckle region in the low-frequency componentimage, with protection for the portrait structure region in thelow-frequency component image, to obtain the low-frequency output imageafter dermabrasion and speckle removal.

Step S230. overlaying the high-frequency output image after dermabrasionand speckle removal with the low-frequency output image afterdermabrasion and speckle removal, to obtain a skin region output image.

Here, “overlaying” refers to a process of adding pixel values ofcorresponding pixels in two images. The high-frequency output imageafter dermabrasion and speckle removal has the same resolution as thelow-frequency output image after dermabrasion and speckle removal.Therefore, in this step, it is possible to add the pixel value of eachpixel in the high-frequency output image after dermabrasion and speckleremoval and the pixel value of the corresponding pixel at thecorresponding position in the low-frequency output image afterdermabrasion and speckle removal to obtain the skin region output image.

The above-mentioned method for processing a portrait image enables toperform optimization processing specific to different high and lowfrequency components and different types of skin regions, while maximizethe retained clarity of the portrait structure region, by means ofdetermining the skin region image in the portrait image to be processed,as well as the skin flat region, the speckle region, and the portraitstructure region included in the high-frequency component image and thelow-frequency component image of the skin region image, and performing adermabrasion processing on the skin flat region and a speckle removalprocessing on the speckle region in the high-frequency component imageand the low-frequency component image, respectively, with protection forthe portrait structure region in the high-frequency component image andthe low-frequency component image. Thus, enabling to present realisticskin texture and protect the clarity of portrait structure while achievedermabrasion and speckle removal on skin in a portrait image, making thebeautified portrait image have a more realistic texture.

According to one embodiment, referring to FIGS. 3 and 4 , the method forprocessing a portrait image further includes the following stepsS240-S250.

Step S240. extracting a non-skin region image from the portrait image tobe processed;

Step S250. stitching the non-skin region image with the skin regionoutput image, to obtain a portrait output image.

Here, the non-skin region refers to images of regions that generally donot include skin. The non-skin region may include, for example,backgrounds, clothing, etc. In this embodiment, the remaining area inthe portrait image after removing a skin region may serve as thenon-skin region after identifying the skin region. In other embodiments,image identification may also be directly performed on the portraitimage to directly identify the non-skin region. After the non-skinregion is determined, a non-skin region image in the non-skin region maybe extracted accordingly.

According to this embodiment, the non-skin region image is furtherstitched with the skin region output image obtained after dermabrasionand a speckle removal processing, to obtain the portrait output imageafter accomplished portrait beautification, so that the portrait outputimage may be displayed to the user through a display screen or othermeans.

According to one embodiment, the dividing the skin region image into ahigh-frequency component image and a low-frequency component imageincludes: performing Gaussian filtering on the skin region image, toobtain the low-frequency component image; and subtracting thelow-frequency component image from the skin region image, to obtain thehigh-frequency component image.

Exemplarily, the Gaussian filtering function of the performed Gaussianfiltering is as follows:

$H_{i,j} = {\frac{1}{2{\pi\sigma}^{2}}{e^{- \frac{i^{2} + j^{2}}{2\sigma^{2}}}.}}$

In the above equation, H_(i,j) represents a filtering parameter that isoffset (i, j) from the center of a filtering window in the filteringwindow of the Gaussian filtering, where i represents a lateral offsetfrom the center of the filtering window; j represents a longitudinaloffset from the center of the filtering window; and σ is a filterstandard deviation for the Gaussian filtering.

Here, the size of the filtering window mentioned above may be determinedbased on the face size in the skin region image, for example, may bedetermined according to the following equation:

${{window}{size}} = {5 + {\frac{S_{face}}{100}.}}$

In the above equation, window size is the size of the filtering window,and S_(face) is the maximum value of the width and height of theidentified face detection box in the image.

It should be understood that, as the angle of the face changes, theidentified face detection box may be square or rectangular, especiallybe rectangular when only half of the face is left in the picture.Therefore, it is capable of more realistically reflecting the scale ofthe face in an actual picture to select the maximum value of the widthand height to characterize the size of the face. For different pictures,the face in a picture may become smaller or larger as the face isfurther away from or closer to the camera. Therefore, for differentpictures, the size of the face detection box is variable. The abovescheme may adaptively modify parameters of the Gaussian filtering basedon the size of the face in the picture.

Here, the larger the value of the filter standard deviation σ of theGaussian filtering, the greater the dermabrasion intensity, andaccordingly, the image will become blurrier. σ may have a suitablenumerical value selected based on empirical values. Exemplarily, σ=20,however, other suitable values may also be taken for σ.

Herein, “subtracting” refers to a process of subtracting the pixelvalues of the corresponding pixels in two images. The skin region imagehas the same resolution as the low-frequency component image in thisembodiment. Therefore, in this embodiment, it is possible to subtract apixel value of a corresponding pixel at a corresponding position in thelow-frequency component image from a pixel value of each pixel in theskin region image, to obtain the skin region output image.

According to one embodiment, the first dermabrasion processing and thesecond dermabrasion processing in the above step S220 are different,and/or the first speckle removal processing and the second speckleprocessing are different.

The high frequency component image and the low frequency component imagerepresent different display components in the skin, respectively. Inthis embodiment, the separate performance of different dermabrasionprocessing and different speckle removal processings on the highfrequency component image and the low frequency component image maydifferentially perform more specific and suitable dermabrasionprocessing and speckle removal processing on the high frequencycomponent image and the low frequency component image, thereby enablingto effectively improve the dermabrasion and speckle removal effects ofthe images obtained through dermabrasion processing and speckle removalprocessing, while making the processed images more delicate andrealistic.

The high-frequency component in the skin flat region (neither theportrait structure region nor the speckle region) is mainly composed ofskin texture. For the processing of this skin texture, options accordingto some alternative embodiments may be as follows: 1) completelypreserving the high-frequency component in the skin flat region (i.e.,performing no processing on the skin flat region in the high-frequencycomponent image), which causes that the skin texture is fully preservedafter the processing, and the processed skin is not delicate enough; and2) performing linear attenuation processing on the high-frequencycomponent, which causes that when the same attenuation coefficient isused for a stronger texture and a weaker texture, either the strongertexture may not be effectively weakened, or the weaker texture iscompletely eliminated, and finally, it is impossible to present such aneffect that the skin texture structure is well preserved, and at thesame time, the delicate skin texture is achieved, although the processedskin texture is relatively delicate.

According to one embodiment, the performing a dermabrasion processing(such as the first dermabrasion processing) on the skin flat region inthe high-frequency component image includes: performing nonlinearattenuation on the skin flat region in the high-frequency componentimage; wherein, in the nonlinear attenuation, each pixel value in thehigh-frequency component image is multiplied by a variable attenuationcoefficient that decreases with the decrease of the pixel valuemultiplied thereby.

The technical solution of this embodiment adopts the nonlinearattenuation method to perform nonlinear attenuation on the skin flatregion in the high-frequency component image, so that a weaker skintexture is multiplied by a smaller variable attenuation coefficient(that is, close to 1.0), and a stronger skin texture is multiplied by agreater variable attenuation coefficient (that is, close to 0.0). FIG. 5shows the nonlinear attenuation curve corresponding to this nonlinearattenuation, which has an expression of −0.0025×x2+x=y, where x is aninput pixel value before nonlinear attenuation, and y is an output pixelvalue after nonlinear attenuation. After nonlinear attenuation, thetexture structure of the image is fully preserved, while the strongertexture is effectively attenuated, thereby presenting a delicate andrealistic skin texture.

After image frequency division, the imaging of the speckle region maskin the high-frequency component image of the portrait image is shown inFIG. 6 . To achieve speckle removal effect, it is necessary to patch thepixels in the speckle region on the high-frequency component image.According to an alternative embodiment, when performing the speckleremoval processing on the speckle region in the high-frequency componentimage, the pixel values of the speckle region (the speckle region maskshown in the right figure of FIG. 6 ) in the high-frequency componentimage may be directly cleared to zero; or alternatively, each pixel inthe speckle region may be also filled with pixels in the “adjacentfour-vertex linear interpolation” manner described later, but the regionfilled in this manner is too smooth, moreover, processing the speckleregion in the high-frequency component image in this manner will lead toloss of skin texture in the speckle region, and the image will be toosmooth and unnatural.

According to one embodiment, the performing the speckle removalprocessing (such as the first speckle processing) on the speckle regionin the high-frequency component image includes: performing mirrorfour-vertex linear interpolation on each pixel in the speckle region inthe high-frequency component image, to fill each pixel; wherein, in themirror four-vertex linear interpolation, for a target pixel to befilled, four boundaries of the speckle region having the target pixel infour direction as of top bottom, left, and right are determined andtaken respectively as centers to determine four symmetrical pixelsoutside the speckle region of the target pixel, and a value determinedby performing bilinear interpolation on the four symmetrical pixels isused as the pixel value of the target pixel, so as to fill the targetpixel.

The technical solution of this embodiment proposes a unique “mirrorfour-vertex linear interpolation” method to fill the speckle region inthe high-frequency component image. For example, as shown in FIG. 7 ,taking pixel A as the target pixel to be filled as an example, the fourboundaries of pixel A in the speckle region mask in four directions oftop, bottom, left, and right are searched through the speckle regionmask (the white pixel area in FIG. 7 ), and are taken respectively ascenters to find the symmetrical pixels B, C, D, and E of pixel A. Thepixel value of pixel A may be obtained by performing bilinearinterpolation on pixels B, C, D and E. The calculation process of thebilinear interpolation is as follows:

V _(a)=1/(D _(ab) +D _(ac) +D _(ad) +D _(ae))*((D _(ad) +D _(ae))*(V_(b) *D _(ac) +V _(c) *D _(ab))/(D _(ad) +D _(ac))+(D _(ab) +D _(ac))*(V_(d) *D _(ae) +V _(e) *D _(ad))/(D _(ab) +D _(ae)))

wherein, D_(ab) is the Euclidean distance between pixel A and pixel B,D_(ac) is the Euclidean distance between pixel A and pixel C, D_(ad) isthe Euclidean distance between pixel A and pixel D, D_(ae) is theEuclidean distance between pixel A and pixel E, V_(a) is the calculatedpixel value of pixel A, V_(b) is the pixel value of pixel B, V_(c) isthe pixel value of pixel C, V_(d) is the pixel value of pixel D, andV_(e) is the pixel value of pixel E.

By repeating this operation, the filling value of each pixel in thespeckle region of the high-frequency component image may be obtained.After the above “mirror four-vertex linear interpolation”, the speckleregion in the high-frequency component image may better restore the skintexture in the high-frequency component image.

According to one embodiment, the performing a dermabrasion processing(such as the second dermabrasion processing) on the skin flat region inthe low-frequency component image includes: performing surface filteringon the skin flat region in the low-frequency component image.

According to this embodiment, for the skin flat region in thelow-frequency component image, a conventional surface filter may be usedas an edge-preserving filter to filter the skin flat region in thelow-frequency component image to obtain an uniform skin base color.

After frequency division of the skin region image, the fine texture andsmall speckles of the skin will be concentrated in the high-frequencycomponent image, while slightly larger speckles will still appear in thelow-frequency component image. To achieve speckle removal effect,speckles may be filled in the low-frequency component image.

According to one embodiment, performing the speckle removal processing(such as the second speckle removal processing) on the speckle region inthe low-frequency component image includes: performing adjacentfour-vertex linear interpolation on each pixel in the speckle region inthe low-frequency component image, to fill each pixel; wherein, in theadjacent four-vertex linear interpolation, for a target pixel to befilled, four nearest neighbor pixels to the target pixel outside thespeckle region in four directions of top, bottom, left and right aredetermined, and a value determined by performing bilinear interpolationon the four nearest neighbor pixels is used as the pixel value of thetarget pixel, so as to fill the target pixel.

According to this embodiment, the “adjacent four-vertex linearinterpolation” method is used to fill the speckle region in thelow-frequency component image. For example, as shown in FIG. 8 , takingpixel A as the target pixel to be filled as an example, the four nearestneighbor pixels F, G, H, I to pixel A outside the speckle region maskthat are closest to pixel A in four directions of top, bottom, left andright are searched through the speckle region mask (the white pixel areain FIG. 8 ), that is, the four boundaries (the four bold line segmentslocated above, below, left, and right of pixel A in FIG. 8 ) of pixel Ain the speckle region mask in four directions of top, bottom, left andright are searched through the speckle region mask. The four pixelsimmediately adjacent to the four boundaries outside the speckle regionmask are the four nearest neighbor pixels F, G, H, and I. The pixelvalue of pixel A may be obtained by performing bilinear interpolation onpixels F, G, H and I. The calculation process of this bilinearinterpolation may similarly refer to that on pixels B, C, D and E, andwill not be elaborated here.

By repeating this operation, the filling value of each pixel in thespeckle region in the low-frequency component image is able to beobtained. After the above “adjacent four-vertex linear interpolation”,the skin in the speckle region in the low-frequency component image issmooth and even, and a good speckle removal effect is able to beachieved.

It should be understood that, in other embodiments, the aforementioned“mirror four-vertex linear interpolation” method may also be used tofill the speckle region in the low-frequency component image.

According to one embodiment, the protection for the portrait structureregion in the high-frequency component image and the low-frequencycomponent image includes: generating a mask for the portrait structureregion; wherein, the mask is used to ensure that, it is prohibited toperform the dermabrasion processing or the speckle removal processing onthe portrait structure region, when performing the dermabrasionprocessing on the skin flat region and the speckle removal processing onthe speckle region in the high-frequency component image and thelow-frequency component image.

As an example, as shown in FIG. 9 , for facial beauty applications, theskin region including the face area may be used as an example. An AImodel (such as the U-NET model mentioned above) may be used to extractthe outer contour area of the face and the facial feature (including,for example, eyes, eyebrows, nose, and mouth) areas as the portraitstructure region, to generate a mask for the portrait structure regionto protect the high-frequency component and low-frequency componentwithin the mask, namely, it is prohibited to perform the dermabrasionprocessing or the speckle removal processing on the portrait structureregion in the high-frequency component image and the low-frequencycomponent image, thereby enabling to avoid image blurring caused by theloss of facial features and contour information, and to maximize theretained clarity of the portrait structure in the image.

It should be understood that, although the steps in the flowcharts ofFIGS. 2-4 are shown sequentially by the arrows, these steps are notnecessarily executed in the order indicated by the arrows. There is nostrict order limit for the execution of these steps, and they may beexecuted in other orders, unless explicitly stated in this context.Moreover, at least a portion of the steps in FIGS. 2-4 may include aplurality of sub-steps or stages, which may not necessarily be completedat the same time, but may be executed at different times, and may havean execution order that may not necessarily be sequential, as well asmay be executed with at least a portion of other steps or sub-steps orstages thereof in turn or alternately.

According to one embodiment, as shown in FIG. 10 , what is provided is adevice for processing a portrait image 1000, which includes a regionimage determination module 1010, a region image processing module 1020,and a skin region output module 1030.

The region image determination module 1010 is used to determine a skinregion image in a portrait image to be processed, as well as a skin flatregion, a speckle region, and a portrait structure region included in ahigh-frequency component image and a low-frequency component image ofthe skin region image.

The region image processing module 1020 is used to perform adermabrasion processing on the skin flat region and a speckle removalprocessing on the speckle region in the high-frequency component imageand the low-frequency component image, respectively, with protection forthe portrait structure region in the high-frequency component image andthe low-frequency component image, to obtain a high-frequency outputimage after dermabrasion and speckle removal and a low-frequency outputimage after dermabrasion and speckle removal.

The skin region output module 1030 is used to overlay the high-frequencyoutput image after dermabrasion and speckle removal with thelow-frequency output image after dermabrasion and speckle removal, toobtain a skin region output image.

According to one embodiment, the device for processing a portrait image1000 further includes:

-   -   a non-skin region extraction module 1040 for extracting a        non-skin region image from the portrait image to be processed;        and    -   a portrait output module 1050 for stitching the non-skin region        image with the skin region output image, to obtain a portrait        output image.

The specific limitations of the device for processing a portrait image1000 may be referred to those of the method for processing a portraitimage in the above and will not be elaborated here. The various modulesin the aforementioned device for processing a portrait image 1000 may befully or partially implemented through software, hardware, andcombinations thereof. The above various modules may be embedded in orindependent on a processor in a computer equipment (such as anelectronic equipment) in a form of a hardware or stored in a memory in acomputer equipment (such as an electronic equipment) in a form of asoftware, for the processor to call and execute the operationscorresponding to the above various modules.

According to one embodiment, what is provided is an electronicequipment, which may have an internal structure diagram as shown in FIG.11 . The electronic equipment includes a processor, a memory, a networkinterface, a display screen, and an input device connected through asystem bus. Here, the processor of the electronic equipment is used toprovide computing and control capabilities. The memory of the electronicequipment includes a non-volatile storage medium with an operatingsystem and a computer program stored therein; and an internal memorywhich provides an environment for the operation of the operating systemand the computer program in the non-volatile storage medium. The networkinterface of the electronic equipment is used to communicate with anexternal terminal through a network connection. The computer program isexecuted by the processor to implement an image distortion correctionmethod. The display screen of the electronic equipment may be, forexample, a liquid crystal display screen. The input device of theelectronic equipment may be a touch layer covered on the display screen,may also be a key, a trackball, or a touchpad provided on a shell of theelectronic equipment, but also an external keyboard, a touchpad, or amouse, or the like.

Those skilled in the art should understand that the structure shown inFIG. 11 is only a block diagram of a portion of the structure related toembodiments of the present application and does not constitute alimitation on the electronic equipment on which the embodiments of thepresent application are applied. Specific electronic equipment mayinclude more or fewer components than those shown in the figure, or mayhave certain components been combined, or have different componentarrangements.

According to one embodiment, as shown in FIG. 12 , what is provided isan electronic equipment 1200, which includes a memory 1201 and aprocessor 1202 connected to each other. The memory 1201 has a computerprogram stored therein. The processor 1202 executes the computer programby performing the following steps:

determining a skin region image in a portrait image to be processed, aswell as a skin flat region, a speckle region, and a portrait structureregion included in a high-frequency component image and a low-frequencycomponent image of the skin region image;

performing a dermabrasion processing on the skin flat region and aspeckle removal processing on the speckle region in the high-frequencycomponent image and the low-frequency component image, respectively,with protection for the portrait structure region in the high-frequencycomponent image and the low-frequency component image, to obtain ahigh-frequency output image after dermabrasion and speckle removal and alow-frequency output image after dermabrasion and speckle removal; and

overlaying the high-frequency output image after dermabrasion andspeckle removal with the low-frequency output image after dermabrasionand speckle removal, to obtain a skin region output image.

According to one embodiment, as shown in FIG. 12 , the electronicequipment 1200 may also include a camera 1203 coupled thereto. The“coupled” aims to include both a form of directly providing the camerain the electronic equipment 1200, and a form of providing the cameraoutside the electronic equipment (such as providing the camera on otherterminal devices) with communication connection between the camera andthe electronic equipment 1200. The camera 1203 and the processor 1202are connected by communication. The camera 1203 is used to capture aportrait image, and transmit the portrait image to the processor 1202.The processor 1202 receives the portrait image from the camera 1203.

According to one embodiment, as shown in FIG. 12 , the electronicequipment 1200 may further include a display 1204 connected to theprocessor 1202. When the processor 1202 executes the computer program,it also controls the display 1204 to display the skin region outputimage or an image (such as a portrait output image) obtained afterprocessing the skin region output image.

According to other embodiments, the processor 1202 further implementsthe steps of the method for processing a portrait image according to theabove various embodiments of the present application when executing thecomputer program, and has the corresponding beneficial effects.

According to one embodiment, what is provided is a computer-readablestorage medium, on which a computer program is stored. The computerprogram is executed by a processor by performing the following steps:

-   -   determining a skin region image in a portrait image to be        processed, as well as a skin flat region, a speckle region, and        a portrait structure region included in a high-frequency        component image and a low-frequency component image of the skin        region image; performing a dermabrasion processing on the skin        flat region and a speckle removal processing on the speckle        region in the high-frequency component image and the        low-frequency component image, respectively, with protection for        the portrait structure region in the high-frequency component        image and the low-frequency component image, to obtain a        high-frequency output image after dermabrasion and speckle        removal and a low-frequency output image after dermabrasion and        speckle removal; and    -   overlaying the high-frequency output image after dermabrasion        and speckle removal with the low-frequency output image after        dermabrasion and speckle removal, to obtain a skin region output        image.

According to other embodiments, the steps of the method for processing aportrait image according to the above various embodiments of the presentapplication are further implemented when the computer program isexecuted by the processor, and having the corresponding beneficialeffects.

Those skilled in the art may understand that, the implementation of allor part of the processes in the methods according to the aboveembodiments may be completed by instructing the relevant hardwarethrough a computer program. The computer program may be stored in anon-volatile computer-readable storage medium and may include processesin examples of the above various methods when being executed. Herein,any reference to memory, storage, database, or other media used in theembodiments provided in the present application may include non-volatileand/or volatile memory. The non-volatile memory may include read-onlymemory (ROM), programmable ROM (PROM), electrically programmable ROM(EPROM), electrically erasable programmable ROM (EEPROM), or flashmemory. The volatile memory may include random-access memory (RAM) orexternal cache. As an explanation rather than limitation, the RAM isavailable in various forms, such as static RAM (SRAM), dynamic RAM(DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM),enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus direct RAM(RDRAM), direct Rambus dynamic RAM (DRDRAM), and Rambus dynamic RAM(RDRAM).

The various technical features of the above embodiments may be combinedarbitrarily. To make the description concise, not all possiblecombinations of various technical features in the above embodiments havebeen described. However, as long as there is no contradiction in thecombinations of these technical features, they should be consideredwithin the scope of this description.

The above embodiments only represent several embodiments of the presentapplication, and the descriptions thereof are relatively specific anddetailed, but may not be understood as limiting the scope of the presentapplication. It should be pointed out that, for those skilled in theart, several modifications and improvements may be further made withoutdeparting from the concept of the present application, all of which fallwithin the scope of protection of the present application. Therefore,the scope of protection of the present application should be based onthe attached claims.

While illustrative implementations of the application have beendescribed in detail herein, it is to be understood that the inventiveconcepts may be otherwise variously embodied and employed, and that theappended claims are intended to be construed to include such variations,except as limited by the prior art.

Reference throughout this specification to “one implementation” or “animplementation” means that a particular feature, structure, orcharacteristic described in connection with the implementation isincluded in at least one implementation of the present invention. Thus,the appearances of the phrases “in one implementation” or “in someimplementations” in various places throughout this specification are notnecessarily all referring to the same implementation. Furthermore, theparticular features, structures, or characteristics may be combined inany suitable manner in one or more implementations.

Systems and methods describing the present invention have beendescribed. It will be understood that the descriptions of someembodiments of the present invention do not limit the variousalternative, modified, and equivalent embodiments which may be includewithin the spirit and scope of the present invention as defined by theappended claims. Furthermore, in the detailed description above,numerous specific details are set forth to provide an understanding ofvarious embodiments of the present invention. However, some embodimentsof the present invention may be practiced without these specificdetails. In other instances, well known methods, procedures, andcomponents have not been described in detail so as not to unnecessarilyobscure aspects of the present embodiments.

What is claimed is:
 1. A method for processing a portrait image,comprising: determining a skin region image in a portrait image to beprocessed, as well as a skin flat region, a speckle region, and aportrait structure region comprised in a high-frequency component imageand a low-frequency component image of the skin region image; performinga dermabrasion processing on the skin flat region and a speckle removalprocessing on the speckle region in the high-frequency component imageand the low-frequency component image, respectively, with protection forthe portrait structure region in the high-frequency component image andthe low-frequency component image, to obtain a high-frequency outputimage after dermabrasion and speckle removal and a low-frequency outputimage after dermabrasion and speckle removal; and overlaying thehigh-frequency output image after dermabrasion and speckle removal withthe low-frequency output image after dermabrasion and speckle removal,to obtain a skin region output image.
 2. The method according to claim1, wherein determining the skin region image in a portrait image to beprocessed, as well as the skin flat region, the speckle region, and theportrait structure region comprised in a high-frequency component imageand the low-frequency component image of the skin region imagecomprises: identifying and extracting the skin region image from theportrait image to be processed; dividing the skin region image into thehigh-frequency component image and the low-frequency component image;and identifying the skin flat region, the speckle region, and theportrait structure region comprised in the high-frequency componentimage and the low-frequency component image, respectively.
 3. The methodaccording to claim 1, further comprising: extracting a non-skin regionimage from the portrait image to be processed; and stitching thenon-skin region image with the skin region output image, to obtain aportrait output image.
 4. The method according to claim 2, whereindividing the skin region image into the high-frequency component imageand the low-frequency component image comprises: performing Gaussianfiltering on the skin region image, to obtain the low-frequencycomponent image; and subtracting the low-frequency component image fromthe skin region image, to obtain the high-frequency component image. 5.The method according to claim 1, wherein performing the dermabrasionprocessing on the skin flat region and the speckle removal processing onthe speckle region in the high-frequency component image and thelow-frequency component image, respectively, with protection for theportrait structure region in the high-frequency component image and thelow-frequency component image, to obtain the high-frequency output imageafter dermabrasion and speckle removal and the low-frequency outputimage after dermabrasion and speckle removal comprises: performing afirst dermabrasion processing on the skin flat region and a firstspeckle removal processing on the speckle region in the high-frequencycomponent image, with protection for the portrait structure region inthe high-frequency component image, to obtain the high-frequency outputimage after dermabrasion and speckle removal; and performing a seconddermabrasion processing on the skin flat region and a second speckleremoval processing on the speckle region in the low-frequency componentimage, with protection for the portrait structure region in thelow-frequency component image, to obtain the low-frequency output imageafter dermabrasion and speckle removal.
 6. The method according to claim5, wherein the first dermabrasion processing is different from thesecond dermabrasion processing, and/or the first speckle removalprocessing is different from the second speckle removal processing. 7.The method according to claim 1, wherein performing the dermabrasionprocessing on the skin flat region in the high-frequency component imagecomprises: performing a nonlinear attenuation on the skin flat region inthe high-frequency component image; wherein, in the nonlinearattenuation, each pixel value in the high-frequency component image ismultiplied by a variable attenuation coefficient that decreases with thedecrease of the pixel value multiplied thereby.
 8. The method accordingto claim 1, wherein performing the speckle removal processing on thespeckle region in the high-frequency component image comprises:performing a mirror four-vertex linear interpolation on each pixel inthe speckle region in the high-frequency component image, to fill eachpixel; wherein, in the mirror four-vertex linear interpolation, for atarget pixel to be filled, four boundaries of the speckle region havingthe target pixel in four directions of top, bottom, left and right aredetermined and taken respectively as centers to determine foursymmetrical pixels outside the speckle region of the target pixel, and avalue determined by performing bilinear interpolation on the foursymmetrical pixels is used as the pixel value of the target pixel, so asto fill the target pixel.
 9. The method according to claim 1, whereinperforming the dermabrasion processing on the skin flat region in thelow-frequency component image comprises: performing surface filtering onthe skin flat region in the low-frequency component image.
 10. Themethod according to claim 1, wherein performing the speckle removalprocessing on the speckle region in the low-frequency component imagecomprises: performing adjacent four-vertex linear interpolation on eachpixel in the speckle region in the low-frequency component image, tofill each pixel; wherein, in the adjacent four-vertex linearinterpolation, for a target pixel to be filled, four nearest neighborpixels to the target pixel outside the speckle region in four directionsof top, bottom, left and right are determined, and a value determined byperforming bilinear interpolation on the four nearest neighbor pixels isused as the pixel value of the target pixel, so as to fill the targetpixel.
 11. The method according to claim 1, wherein the protection forthe portrait structure region in the high-frequency component image andthe low-frequency component image comprises: generating a mask for theportrait structure region; wherein, the mask is used to ensure that, itis prohibited to perform the dermabrasion processing or the speckleremoval processing on the portrait structure region, when performing thedermabrasion processing on the skin flat region and the speckle removalprocessing on the speckle region in the high-frequency component imageand the low-frequency component image.
 12. A device for processing aportrait image, comprising: a region image determination module fordetermining a skin region image in a portrait image to be processed, aswell as a skin flat region, a spot region, and a portrait structureregion comprised in a high-frequency component image and a low-frequencycomponent image of the skin region image; a region image processingmodule for performing a dermabrasion processing on the skin flat regionand a speckle removal processing on the speckle region in thehigh-frequency component image and the low-frequency component image,respectively, with protection for the portrait structure region in thehigh-frequency component image and the low-frequency component image, toobtain a high-frequency output image after dermabrasion and speckleremoval and a low-frequency output image after dermabrasion and speckleremoval; and a skin region output module for overlaying thehigh-frequency output image after dermabrasion and speckle removal withthe low-frequency output image after dermabrasion and speckle removal,to obtain a skin region output image.
 13. An electronic equipment,comprising a memory that stores a computer program and a processor,wherein the processor executes the computer program by performing stepsof the method according to claim
 1. 14. A non-transitorycomputer-readable storage medium on which a computer program is stored,wherein the computer program is executed by a processor by performingsteps of the method according to claim 1.